using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Shop;
using System;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Shop_shopIndex : Shop, IRequiresSessionState
{
	protected PlaceHolder linkcss;
	protected PlaceHolder PlaceRepair;
	protected Repeater RecommendationList;
	protected Repeater ReCommentList;
	protected HtmlInputHidden PageCountID;
	protected Label lbPage;
	protected Label PopularSearch;
	protected DataList DataClassList;
	protected Repeater ReFriendLink;
	protected Repeater ReTheadList;
	protected HtmlAnchor ButReply;
	protected HtmlAnchor ButEdit;
	protected HtmlAnchor ButSetsgoes;
	protected HtmlAnchor NotSetsgoes;
	protected HtmlAnchor ButEssence;
	protected HtmlAnchor NotEssence;
	protected HtmlAnchor ButLock;
	protected HtmlAnchor NotLock;
	protected HtmlAnchor ButDel;
	protected HtmlTable PlaceOperation;
	protected HtmlGenericControl ThreadContent;
	protected Repeater ReplyList;
	protected HiddenField HiddenThreadID;
	protected HiddenField HiddenIsOwner;
	protected Label LbExchangePage;
	protected Label ProductRankName;
	protected Repeater ReShopRankList;
	protected Label ProductListName;
	protected Repeater ReProductList;
	protected Label lbProductNumber;
	protected Repeater ReAllProductList;
	protected Label AllProductPage;
	protected Repeater ReHomeThreadList;
	protected HiddenField HiddenShopLogo;
	protected HiddenField Hiddendianbiao;
	protected HiddenField HiddenBackGroundImage;
	protected HiddenField HiddenShopTitle;
	protected HiddenField HiddenShowType;
	protected HiddenField HiddenShopID;
	protected HiddenField HiddenUserID;
	protected HiddenField HiddenUserName;
	protected HiddenField HiddenIslock;
	protected HiddenField HiTopCusName;
	protected HiddenField HiTopCusComment;
	protected HiddenField HiLeftCusName;
	protected HiddenField HiLeftCusComment;
	protected HiddenField HiRightCusName;
	protected HiddenField HiRightCusComment;
	protected HtmlForm form1;
	protected HtmlGenericControl myhtml;
	public int ShopID = 0;
	protected string TemplateText = "";
	public int TJImgHeight = 120;
	public int TJImgWidth = 120;
	public int ProImgHeight = 120;
	public int ProImgWidth = 120;
	protected string ColumnTag = "HomePage";
	protected string FolderPath = "";
	public int PageSizeCount = 0;
	public int PageThreadCount = 0;
	public int PageReplyCount = 0;
	public string replyContent = "";
	private CurrPageLinks CurrenPage = new CurrPageLinks();
	public int ReplyThreadID = 0;
	protected string WstrPrice = "";
	protected int threadNum = 3;
	protected string ThstrOrdery = "";
	protected int SalerID = 0;
	public string SeeWay = "";
	public string StrCss = "";
	protected int cssID = 0;
	protected string ShopTitle = "";
	protected string StrShopName = "";
	private Shop_Shop _Shop = new Shop_Shop(new Conn());
	public double SGoodRate = 0.0;
	public int SWeekGoodRate = 0;
	public int SWeekNormalRate = 0;
	public int SWeekBadRate = 0;
	public int SMouthGoodRate = 0;
	public int SMouthNormalRate = 0;
	public int SMouthBadRate = 0;
	public int SSixMGoodRate = 0;
	public int SSixMNormalRate = 0;
	public int SSixMBadRate = 0;
	public int SPreSixMGoodRate = 0;
	public int SPreSixMNormalRate = 0;
	public int SPreSixMBadRate = 0;
	public int SXTotalGoodRate = 0;
	public int SXTotalNormalRate = 0;
	public int SXTotalBadRate = 0;
	public int CountSalerCredit = 0;
	private Shop_Product _shop_product = null;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected Shop_Product m_shop_product
	{
		get
		{
			Shop_Product shop_product;
			if (this._shop_product == null)
			{
				this._shop_product = new Shop_Product(this.conn);
				shop_product = this._shop_product;
			}
			else
			{
				shop_product = this._shop_product;
			}
			return shop_product;
		}
	}
	protected void Page_PreInit(object sender, EventArgs e)
	{
		this.TemplateText = Template.GetTemplate(Template.GetTemplatePath("header"));
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		try
		{
			if (Fetch.GetID("ShopID") > 0)
			{
				this.ShopID = Fetch.GetID("ShopID");
			}
			else
			{
				this.ShopID = this._Shop.GetShopIDByShopOwerID(base.user.UserID);
			}
			IDbDataParameter dbDataParameter = this.conn.CreateParameter("@ShopID", DbType.Int32, this.ShopID);
			DataTable dataTable = this.conn.GetDataTable("select * from dbo.HLShop_Shop where ShopID=@ShopID and IsUseSecUrl=1 ", new IDbDataParameter[]
			{
				dbDataParameter
			});
			string text = string.Empty;
			if (dataTable != null && dataTable.Rows.Count > 0)
			{
				text = dataTable.Rows[0]["SecUrl"].IsNull(new object[0]);
			}
			if (!string.IsNullOrEmpty(text) && base.Request.Url.ToString().ToLower().IndexOf((text.Trim() + "." + this.config["ShopRootUrl"]).ToLower()) < 0)
			{
				if (!string.IsNullOrEmpty(text.Trim()) && text.Trim() != "" && this.config["IsUserSecUrl"].ToString() == "1")
				{
					if (base.Request.QueryString["SalerID"] != null)
					{
						base.Response.Cookies["ShopSalerID"].Value = base.Request.QueryString["SalerID"];
					}
					base.Response.Redirect(string.Concat(new string[]
					{
						"http://",
						text.Trim(),
						".",
						this.config["ShopRootUrl"].ToString(),
						"/store/shopindex.aspx?",
						base.Request.Url.ToString().Substring(base.Request.Url.ToString().IndexOf(".aspx?") + ".aspx?".Length)
					}));
				}
			}
			if (this.config["IsUserSecUrl"].ToString() == "1")
			{
				if (base.Request.Url.ToString().ToLower().IndexOf("." + this.config["ShopRootUrl"]) > 0)
				{
					string text2 = base.Request.Url.ToString().Substring(7, base.Request.Url.ToString().ToLower().IndexOf("." + this.config["ShopRootUrl"]) - 7);
					if (!string.IsNullOrEmpty(text2))
					{
						dataTable = this.conn.GetDataTable("select * from dbo.HLShop_Shop where SecUrl='" + text2 + "' and IsUseSecUrl=1");
						if (dataTable != null && dataTable.Rows.Count > 0)
						{
							this.ShopID = Convert.ToInt32(dataTable.Rows[0]["ShopID"]);
						}
					}
				}
			}
			if (base.Request.QueryString["SalerID"] != null)
			{
				base.Response.Cookies["ShopSalerID"].Value = base.Request.QueryString["SalerID"];
				base.Response.Cookies["ShopSalerID"].Expires.AddHours(1.0);
			}
			Shop_Product shop_Product = new Shop_Product();
			if (base.Request.Cookies["ShopSalerID"] != null)
			{
				try
				{
					this.SalerID = int.Parse(base.Request.Cookies["ShopSalerID"].Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					this.SalerID = 0;
				}
				if (!shop_Product.JustOpenShop(this.SalerID))
				{
					this.WriteErrMsg("", Language.Get("Member/Common/NoShop"), "/Member/Shop_OpenShop.aspx");
				}
			}
			else
			{
				this.SalerID = base.user.UserID;
			}
			if (this.ShopID == 0)
			{
				base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('加载店铺数据出错！')</script>");
			}
			else
			{
				if (this.conn.ExecuteCount("select count(*) from HLShop_Shop where ShopID=" + this.ShopID + " and  ShopID not in (select ShopID from  [HL_User]  where IsLocked=1)") < 1)
				{
					this.PlaceRepair.Visible = true;
					this.WriteErrMsg("", "店铺不存在或被锁定！", "");
				}
				else
				{
					string sql = "select ShopOwnerID from HLShop_Shop where ShopID=" + this.ShopID;
					DataTable dataTable2 = this.conn.GetDataTable(sql);
					if (dataTable2.Rows.Count > 0)
					{
						if (dataTable2.Rows[0]["ShopOwnerID"] != DBNull.Value)
						{
							if (dataTable2.Rows[0]["ShopOwnerID"].ToInt32(new int[0]) == base.user.UserID)
							{
								this.PlaceRepair.Visible = true;
							}
							else
							{
								this.PlaceRepair.Visible = false;
							}
						}
					}
					DataTable dataTable3 = this.conn.GetDataTable("select * from HLShop_Shop where ShopID=" + this.ShopID);
					int num = 0;
					if (base.Request.QueryString["SeeWay"] != null)
					{
						try
						{
							num = int.Parse(base.Request.QueryString["cssID"]);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[]
							{
								"正常操作"
							});
							num = 0;
						}
						if (num > 0)
						{
							this.FolderPath = "CSS/css" + num.ToString();
							DirectoryInfo directoryInfo = new DirectoryInfo(base.Server.MapPath(this.FolderPath));
							FileSystemInfo[] fileSystemInfos = directoryInfo.GetFileSystemInfos();
							for (int i = 0; i < fileSystemInfos.Length; i++)
							{
								FileSystemInfo fileSystemInfo = fileSystemInfos[i];
								this.linkcss.Controls.Add(this._Shop.ChangeSkin(this.FolderPath + "/" + Path.GetFileName(fileSystemInfo.FullName)));
							}
						}
						else
						{
							num = int.Parse(dataTable3.Rows[0]["cssID"].ToString());
							this.FolderPath = "CSS/css" + num.ToString();
							DirectoryInfo directoryInfo = new DirectoryInfo(base.Server.MapPath(this.FolderPath));
							FileSystemInfo[] fileSystemInfos = directoryInfo.GetFileSystemInfos();
							for (int i = 0; i < fileSystemInfos.Length; i++)
							{
								FileSystemInfo fileSystemInfo = fileSystemInfos[i];
								this.linkcss.Controls.Add(this._Shop.ChangeSkin(this.FolderPath + "/" + Path.GetFileName(fileSystemInfo.FullName)));
							}
						}
						this.TemplateText = this.TemplateText.Replace("{$SeeWay}", "&SeeWay=" + base.Request.QueryString["SeeWay"]);
					}
					else
					{
						num = int.Parse(dataTable3.Rows[0]["cssID"].ToString());
						this.FolderPath = "CSS/css" + num.ToString();
						DirectoryInfo directoryInfo = new DirectoryInfo(base.Server.MapPath(this.FolderPath));
						FileSystemInfo[] fileSystemInfos = directoryInfo.GetFileSystemInfos();
						for (int i = 0; i < fileSystemInfos.Length; i++)
						{
							FileSystemInfo fileSystemInfo = fileSystemInfos[i];
							this.linkcss.Controls.Add(this._Shop.ChangeSkin(this.FolderPath + "/" + Path.GetFileName(fileSystemInfo.FullName)));
						}
						this.TemplateText = this.TemplateText.Replace("{$SeeWay}", "");
					}
					this.TemplateText = this.TemplateText.Replace("{$cssID}", "&cssID=" + num);
					this.StrShopName = dataTable3.Rows[0]["ShopName"].ToString();
					dataTable3.Dispose();
					if (base.Request.QueryString["SeeWay"] != null)
					{
						if (base.Request.QueryString["SeeWay"] == "Issue")
						{
							this.SeeWay = "&SeeWay=Issue";
						}
					}
					if (base.Request.QueryString["cssID"] != null)
					{
						try
						{
							num = int.Parse(base.Request.QueryString["cssID"]);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[]
							{
								"正常操作"
							});
							num = 0;
						}
					}
					if (num > 0)
					{
						this.StrCss = "&cssID=" + num;
					}
					this.HiddenShopID.Value = this.ShopID.ToString();
					this.HiddenUserID.Value = base.user.UserID.ToString();
					this.HiddenUserName.Value = base.user.UserName;
					this.TemplateText = this.TemplateText.Replace("{$ShopID}", this.ShopID.ToString());
					if (this.IsStorekeeper(this.ShopID, base.user.UserID))
					{
						this.HiddenIsOwner.Value = "1";
					}
					this.ShowTopShopInfo(this.ShopID);
					this.ShowColumnInfo();
					base.ClientRelation(this.ShopID, "browse");
					this.TemplateText = this.TemplateText.Replace("{$ShopTitle}", this.ShopTitle);
					try
					{
						Template.BindTextToPage(this.Page, this.TemplateText);
					}
					catch (Exception ex)
					{
						base.WriteTemErrMsg(ex.Message.ToString());
					}
				}
			}
		}
		catch (Exception ex2)
		{
			this.WriteErrMsg("", "加载店铺出错，可能是系统找不到店铺对应的模块！<br/>出错代码：" + ex2.Message, "");
		}
	}
	public void ShowColumnInfo()
	{
		if (base.Request.QueryString["ColumnTag"] != null && base.Request.QueryString["ColumnTag"] != "")
		{
			this.ColumnTag = base.Request.QueryString["ColumnTag"];
		}
		string columnTag = this.ColumnTag;
		switch (columnTag)
		{
		case "HomePage":
			this.ShowShopClass(this.ShopID);
			this.BindFriendLink();
			this.ShopPreview(this.ShopID);
			this.ShopTitle = "首页--" + this.StrShopName;
			break;
		case "CreditStatus":
			this.ShowSalerInfo();
			this.ShowCommentInfo();
			this.ShopTitle = "信用评价--" + this.StrShopName;
			break;
		case "ExchangeArea":
			if (base.Request.QueryString["IsThread"] != null)
			{
				if (base.Request.QueryString["IsThread"] == "Yes")
				{
					this.ShowThead();
				}
				else
				{
					this.ShowReplyThread();
				}
			}
			else
			{
				this.ShowThead();
			}
			this.ShopTitle = "交流区--" + this.StrShopName;
			break;
		case "ProductList":
			this.ShowShopClass(this.ShopID);
			this.BindFriendLink();
			this.ShopPreview(this.ShopID);
			this.ShowAllProduct(this.ShopID);
			this.ShopTitle = "全部商品--" + this.StrShopName;
			break;
		case "ShopInfo":
			this.ShowShopInfo(this.ShopID);
			this.ShopTitle = "店铺介绍--" + this.StrShopName;
			break;
		case "RepurchaseExplain":
			this.ShowRepurchaseExplain(this.ShopID);
			this.ShopTitle = "回购说明--" + this.StrShopName;
			break;
		case "BuyNotes":
			this.ShowBuyNotes(this.ShopID);
			this.ShopTitle = "购买须知--" + this.StrShopName;
			break;
		}
	}
	public string CountTypePrice(string ProductID, string ProductType)
	{
		string result;
		if (this._shop_product.CountTypePrice(ProductID, ProductType) == null)
		{
			result = "是";
		}
		else
		{
			result = "否";
		}
		return result;
	}
	public void ShowTopShopInfo(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLShop_Shop where ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			this.SalerID = int.Parse(dataTable.Rows[0]["ShopOwnerID"].ToString());
			this.Hiddendianbiao.Value = dataTable.Rows[0]["ShopImageUrl"].ToString();
			this.HiddenBackGroundImage.Value = dataTable.Rows[0]["BackgroundImage"].ToString();
			this.HiddenShopTitle.Value = dataTable.Rows[0]["ShopName"].ToString();
			this.HiddenShowType.Value = dataTable.Rows[0]["ShowType"].ToString();
			this.HiddenShopLogo.Value = dataTable.Rows[0]["LogoPath"].ToString();
		}
		dataTable.Dispose();
		DataTable dataTable2 = this.conn.GetDataTable("select UserName,c.Province,c.City,c.ShopRegDate as RegDate from HL_User as a, HL_UserInfo as b,HLShop_Shop as c where a.UserID=b.UserID and b.UserID=c.ShopOwnerID and b.ShopID=c.ShopID and b.ShopID=" + ShopID);
		if (dataTable2 != null && dataTable2.Rows.Count > 0)
		{
			DataRow dataRow = dataTable2.Rows[0];
			this.TemplateText = this.TemplateText.Replace("{$SalerName}", (dataRow["UserName"].ToString() == "") ? "没有信息" : dataRow["UserName"].ToString());
			this.TemplateText = this.TemplateText.Replace("{$Region}", dataRow["Province"].ToString() + dataRow["City"].ToString());
			this.TemplateText = this.TemplateText.Replace("{$ShopCreateDate}", dataRow["RegDate"].ToString());
		}
		else
		{
			this.TemplateText = this.TemplateText.Replace("{$SalerName}", "未知");
			this.TemplateText = this.TemplateText.Replace("{$Region}", "未知");
			this.TemplateText = this.TemplateText.Replace("{$ShopCreateDate}", "未知");
		}
		dataTable2.Dispose();
		double num = (double)this.m_shop_product.BindSaleCrediet(this.SalerID);
		double num2 = (double)this.m_shop_product.BindSaleCredietTotalCount(this.SalerID);
		this.TemplateText = this.TemplateText.Replace("{$TotalCredit}", num.ToString());
		if (num2 != 0.0)
		{
			this.TemplateText = this.TemplateText.Replace("{$TotalGoodRate}", (Math.Round(num / num2, 2) * 100.0).ToString());
		}
		else
		{
			this.TemplateText = this.TemplateText.Replace("{$TotalGoodRate}", "0.00");
		}
	}
	public void ShowShopClass(int ShopID)
	{
		StringBuilder stringBuilder = new StringBuilder();
		string str = "select a.ShopProductClassID as CID,ShopProductClassName as ClassName from HLShop_ProductLikeCategory as a \r\n                            join HLShop_Product as b on a.shopID=b.shopID join HLShop_Class as c on c.ClassID=b.ClassID ";
		string text = " and a.shopID=" + ShopID;
		string str2 = " group by a.ShopProductClassID,a.ShopProductClassName order by a.ShopProductClassID desc";
		string text2 = "";
		if (base.user.UserID > 0)
		{
			if (base.Request.QueryString["SalerID"] != null)
			{
				string text3 = base.Request.QueryString["SalerID"].ToString();
				if (Convert.ToInt32(text3) != base.user.UserID)
				{
					text2 = text3;
				}
			}
			if (!string.IsNullOrEmpty(text2))
			{
				text = text + " and b.SalerID=" + text2;
			}
			string value = str + text + str2;
			stringBuilder.Append(value);
		}
		else
		{
			if (base.Request.QueryString["SalerID"] != null)
			{
				text2 = base.Request.QueryString["SalerID"].ToString();
				text = text + " and b.SalerID=" + text2;
			}
			string value2 = str + text + str2;
			stringBuilder.Append(value2);
		}
		this.DataClassList.DataSource = this.conn.GetDataSet(stringBuilder.ToString());
		this.DataClassList.DataBind();
	}
	public void ShowSalerInfo()
	{
		string a = "Week";
		this.TemplateText = this.TemplateText.Replace("{$ShopBuyerCredit}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=0").ToString());
		if (base.Request.QueryString["JustDate"] != null && base.Request.QueryString["JustDate"] != "")
		{
			a = base.Request.QueryString["JustDate"].ToString();
		}
		if (a == "Week")
		{
			this.TemplateText = this.TemplateText.Replace("{$GoodComment}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=0 and DateDiff(WW,CreateTime,getdate())<=1").ToString());
			this.TemplateText = this.TemplateText.Replace("{$Comments}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=0 and JustSBCredit=0 and DateDiff(WW,CreateTime,getdate())<=1").ToString());
			this.TemplateText = this.TemplateText.Replace("{$BadComment}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=-1 and JustSBCredit=0 and DateDiff(WW,CreateTime,getdate())<=1").ToString());
		}
		else
		{
			this.TemplateText = this.TemplateText.Replace("{$GoodComment}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=0 and DateDiff(MM,CreateTime,getdate())<=1").ToString());
			this.TemplateText = this.TemplateText.Replace("{$Comments}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=0 and JustSBCredit=0 and DateDiff(MM,CreateTime,getdate())<=1").ToString());
			this.TemplateText = this.TemplateText.Replace("{$BadComment}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=-1 and JustSBCredit=0 and DateDiff(MM,CreateTime,getdate())<=1").ToString());
		}
		double num = (double)this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=0");
		double num2 = (double)this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and JustSBCredit=0");
		string text = (Math.Round(num / num2, 2) * 100.0).ToString();
		if (text == "非数字")
		{
			text = "0";
		}
		this.TemplateText = this.TemplateText.Replace("{$GoodCommentRate}", text);
	}
	public void ShowShopInfo(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLShop_Shop as a,HL_UserInfo as b where a.ShopOwnerID=b.UserID and a.ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			DataRow dataRow = dataTable.Rows[0];
			string newValue = dataRow["ShopName"].ToString();
			this.TemplateText = this.TemplateText.Replace("{$ShopIntroduction}", dataRow["ShopIntro"].ToString());
			this.TemplateText = this.TemplateText.Replace("{$ShopUserName}", dataRow["ShopOwnerName"].ToString());
			this.TemplateText = this.TemplateText.Replace("{$ShopName}", newValue);
			string newValue2 = dataRow["Province"].ToString();
			string newValue3 = dataRow["City"].ToString();
			string newValue4 = "";
			string newValue5 = dataRow["ShopAddress"].ToString();
			if (dataRow["Area"] != DBNull.Value)
			{
				newValue4 = dataRow["Area"].ToString();
			}
			this.TemplateText = this.TemplateText.Replace("{$ShopProvince}", newValue2);
			this.TemplateText = this.TemplateText.Replace("{$ShopCity}", newValue3);
			this.TemplateText = this.TemplateText.Replace("{$ShopArea}", newValue4);
			this.TemplateText = this.TemplateText.Replace("{$ShopAddress}", newValue5);
			this.TemplateText = this.TemplateText.Replace("{$RegistDateTime}", dataRow["ShopRegDate"].ToString());
			if (dataRow["MobilePhone"].ToString() != "")
			{
				this.TemplateText = this.TemplateText.Replace("{$SalerTelPhone}", dataRow["MobilePhone"].ToString());
			}
			else
			{
				this.TemplateText = this.TemplateText.Replace("{$SalerTelPhone}", dataRow["HomePhone"].ToString());
			}
		}
		dataTable.Dispose();
		this.TemplateText = this.TemplateText.Replace("{$SalerCredit}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=0").ToString());
		this.TemplateText = this.TemplateText.Replace("{$BuyerCredit}", this.conn.ExecuteCount("select count(*) from HLMall_Credit where ByValuerID=" + this.SalerID + " and CreditScore=1 and JustSBCredit=1").ToString());
	}
	public void ShowRepurchaseExplain(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLShop_Shop as a,HL_UserInfo as b where a.ShopOwnerID=b.UserID and a.ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			DataRow dataRow = dataTable.Rows[0];
			this.TemplateText = this.TemplateText.Replace("{$RepurchaseExplain}", dataRow["RepurchaseExplain"].ToString());
		}
		dataTable.Dispose();
	}
	public void ShowBuyNotes(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLShop_Shop as a,HL_UserInfo as b where a.ShopOwnerID=b.UserID and a.ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			DataRow dataRow = dataTable.Rows[0];
			this.TemplateText = this.TemplateText.Replace("{$BuyNotes}", dataRow["BuyNotes"].ToString());
		}
		dataTable.Dispose();
	}
	public void ShowCommentInfo()
	{
		string text = "";
		string str = "";
		string str2 = "";
		string value = "";
		string text2 = "SalerRate";
		string text3 = "0";
		string text4 = "-1";
		int num = 1;
		string str3;
		if (text2 == "OtherRate")
		{
			str3 = " and a.ValuerID=" + base.user.UserID;
			value = "  where a.ValuerID=" + base.user.UserID;
		}
		else
		{
			str3 = " and a.ByValuerID=" + base.user.UserID;
		}
		text += str3;
		if (base.Request.QueryString["RateType"] != null)
		{
			string text5 = base.Request.QueryString["RateType"];
			if (text5 == "1" || text5 == "2" || text5 == "3")
			{
				text3 = text5;
			}
		}
		if (base.Request.QueryString["CommentRate"] != null)
		{
			string text6 = base.Request.QueryString["CommentRate"];
			if (text6 == "1" || text6 == "0")
			{
				text4 = text6;
			}
		}
		try
		{
			num = int.Parse(base.Request.QueryString["Pageindex"]);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			num = 1;
		}
		if (num <= 0)
		{
			num = 1;
		}
		int num2 = (num - 1) * 10;
		string text7 = text3;
		if (text7 != null)
		{
			if (!(text7 == "1"))
			{
				if (!(text7 == "2"))
				{
					if (text7 == "3")
					{
						str = " and CreditScore=-1";
					}
				}
				else
				{
					str = " and CreditScore=0";
				}
			}
			else
			{
				str = " and CreditScore=1";
			}
		}
		text += str;
		text7 = text4;
		if (text7 != null)
		{
			if (!(text7 == "1"))
			{
				if (text7 == "0")
				{
					str2 = " and (Comment='' or Comment is null)";
				}
			}
			else
			{
				str2 = " and Comment<>'' and Comment is not null";
			}
		}
		text += str2;
		SqlParameter[] array = new SqlParameter[]
		{
			this.conn.CreateSQlParameter("@WhoRate", SqlDbType.VarChar, text2, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@StrWhere", SqlDbType.VarChar, text, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@PageSize", SqlDbType.Int, num2, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@TotalCount", SqlDbType.Int, 0, ParameterDirection.Output),
			this.conn.CreateSQlParameter("@StrNotAnd", SqlDbType.VarChar, value, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@UserID", SqlDbType.Int, base.user.UserID, ParameterDirection.Input)
		};
		DataTable dataTable = this.conn.GetDataTable("PR_luoCommentPaging", array);
		this.ReCommentList.DataSource = dataTable;
		this.ReCommentList.DataBind();
		if (array[3].Value != null && array[3].Value.ToString() != "")
		{
			this.PageSizeCount = int.Parse(array[3].Value.ToString());
		}
		int num3 = (int)Math.Ceiling((double)this.PageSizeCount / 10.0);
		this.PageCountID.Value = num3.ToString();
		this.lbPage.Text = this.CurrenPage.CurrPageLink(num, 10, this.PageSizeCount, "条评价", string.Concat(new object[]
		{
			"ShopIndex.aspx?ShopID=",
			this.ShopID,
			"&ColumnTag=",
			this.ColumnTag,
			"&WhoRate=",
			text2,
			this.SeeWay,
			this.StrCss,
			"&RateType=",
			text3,
			"&CommentRate=",
			text4,
			"&pageindex"
		}));
	}
	public string Levelrate(string RateScore)
	{
		string result = "<img src='../Images/CreditImage/rate-ok.gif'/>好评";
		if (RateScore != null)
		{
			if (!(RateScore == "0"))
			{
				if (RateScore == "-1")
				{
					result = "<img src='../Images/CreditImage/rate-bad.gif'/>差评";
				}
			}
			else
			{
				result = "<img src='../Images/CreditImage/rate-normal.gif'/>中评";
			}
		}
		return result;
	}
	public void ShowThead()
	{
		this.ThreadWhere();
		string value = "NewThread";
		string text = "Yes";
		string text2 = "";
		string value2 = "";
		string text3 = "";
		string text4 = "";
		int num = 0;
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (base.Request.QueryString["SeeWay"] == "Issue")
			{
				text3 = "&SeeWay=Issue";
			}
		}
		if (base.Request.QueryString["cssID"] != null)
		{
			try
			{
				num = int.Parse(base.Request.QueryString["cssID"]);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num = 0;
			}
		}
		if (num > 0)
		{
			text4 = "&cssID=" + num;
		}
		if (!this.IsStorekeeper(this.ShopID, base.user.UserID))
		{
			text = "No";
		}
		if (text == "No")
		{
			text2 = " and a.ThreadID=b.ThreadID and a.ShopID=" + this.ShopID + " and Locking=0";
		}
		else
		{
			text2 = " a.ShopID=" + this.ShopID;
		}
		if (base.Request.QueryString["SetTag"] != null)
		{
			if (base.Request.QueryString["SetTag"] == "Essence")
			{
				text2 += " and EssenceArea=1";
			}
		}
		int num2 = 1;
		if (base.Request.QueryString["Pageindex"] != null)
		{
			try
			{
				num2 = int.Parse(base.Request.QueryString["Pageindex"]);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num2 = 1;
			}
		}
		if (num2 <= 0)
		{
			num2 = 1;
		}
		if (this.threadNum == 0)
		{
			this.threadNum = 20;
		}
		int num3 = (num2 - 1) * this.threadNum;
		SqlParameter[] array = new SqlParameter[]
		{
			this.conn.CreateSQlParameter("@IsNewThread", SqlDbType.VarChar, value, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@setOrderBy", SqlDbType.VarChar, this.ThstrOrdery, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@StrWhere", SqlDbType.VarChar, text2, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@IsOwner", SqlDbType.VarChar, text, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@setShowNum", SqlDbType.Int, this.threadNum, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@PageSize", SqlDbType.Int, num3, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@TotalCount", SqlDbType.Int, 0, ParameterDirection.Output),
			this.conn.CreateSQlParameter("@StrCountWhere", SqlDbType.VarChar, value2, ParameterDirection.Input)
		};
		DataTable dataTable = this.conn.GetDataTable("PR_luoThreadReply", array);
		this.ReTheadList.DataSource = dataTable;
		this.ReTheadList.DataBind();
		if (array[6].Value != null && array[6].Value.ToString() != "")
		{
			this.PageThreadCount = int.Parse(array[6].Value.ToString());
		}
		int num4 = (int)Math.Ceiling((double)this.PageThreadCount / 2.0);
		this.LbExchangePage.Text = this.CurrenPage.CurrPageLink(num2, this.threadNum, this.PageThreadCount, "条帖子", string.Concat(new object[]
		{
			"ShopIndex.aspx?ShopID=",
			this.ShopID,
			"&ColumnTag=",
			this.ColumnTag,
			text3,
			text4,
			"&IsThread=Yes&pageindex"
		}));
	}
	public string replyUserNameTime(string ThreadID)
	{
		string result = "";
		DataTable dataTable = this.conn.GetDataTable("select replyWriter,CreateTime from HLMall_Threadreply where replyID in(select max(replyID) from HLMall_Threadreply group by threadID) and AutoReply<>-1 and threadID=" + int.Parse(ThreadID));
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			result = dataTable.Rows[0]["CreateTime"].ToString() + "<br/>" + dataTable.Rows[0]["replyWriter"].ToString();
		}
		dataTable.Dispose();
		return result;
	}
	public void ShowReplyThread()
	{
		string value = "ReplyThread";
		string value2 = "Yes";
		string value3 = "";
		string value4 = "";
		string value5 = " order by replyID desc";
		int num = 1;
		if (base.Request.QueryString["ThreadID"] != null)
		{
			try
			{
				this.ReplyThreadID = int.Parse(base.Request.QueryString["ThreadID"]);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				this.ReplyThreadID = 0;
			}
		}
		this.HiddenThreadID.Value = this.ReplyThreadID.ToString();
		int[] array = this.JustThreadStatus(this.ReplyThreadID.ToString());
		if (!this.IsStorekeeper(this.ShopID, base.user.UserID) && this.IsThreadWriter(this.ReplyThreadID.ToString()) == 1)
		{
			this.ButEdit.Visible = true;
		}
		else
		{
			if (this.IsStorekeeper(this.ShopID, base.user.UserID))
			{
				if (this.IsThreadWriter(this.ReplyThreadID.ToString()) == 0)
				{
					this.ButEdit.Visible = true;
				}
				if (array[1] == 1)
				{
					this.NotSetsgoes.Visible = true;
				}
				else
				{
					this.ButSetsgoes.Visible = true;
				}
				if (array[0] == 1)
				{
					this.NotEssence.Visible = true;
				}
				else
				{
					this.ButEssence.Visible = true;
				}
				if (array[2] == 1)
				{
					this.NotLock.Visible = true;
				}
				else
				{
					this.ButLock.Visible = true;
				}
				this.ButDel.Visible = true;
			}
		}
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_Thread where ThreadID=" + this.ReplyThreadID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			this.replyContent = dataTable.Rows[0]["threadContent"].ToString();
			this.HiddenIslock.Value = dataTable.Rows[0]["Locking"].ToString();
		}
		dataTable.Dispose();
		value3 = " and AutoReply<>-1 and ThreadID=" + this.ReplyThreadID;
		value4 = " where AutoReply<>-1 and ThreadID=" + this.ReplyThreadID;
		if (base.Request.QueryString["Pageindex"] != null)
		{
			try
			{
				num = int.Parse(base.Request.QueryString["Pageindex"]);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num = 1;
			}
		}
		int num2 = (num - 1) * 10;
		SqlParameter[] array2 = new SqlParameter[]
		{
			this.conn.CreateSQlParameter("@IsNewThread", SqlDbType.VarChar, value, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@setOrderBy", SqlDbType.VarChar, value5, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@StrWhere", SqlDbType.VarChar, value3, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@IsOwner", SqlDbType.VarChar, value2, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@setShowNum", SqlDbType.Int, 10, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@PageSize", SqlDbType.Int, num2, ParameterDirection.Input),
			this.conn.CreateSQlParameter("@TotalCount", SqlDbType.Int, 0, ParameterDirection.Output),
			this.conn.CreateSQlParameter("@StrCountWhere", SqlDbType.VarChar, value4, ParameterDirection.Input)
		};
		DataTable dataTable2 = this.conn.GetDataTable("PR_luoThreadReply", array2);
		this.ReplyList.DataSource = dataTable2;
		this.ReplyList.DataBind();
		if (base.user.UserID <= 0)
		{
			this.ButReply.Visible = false;
			for (int i = 0; i < this.ReplyList.Items.Count; i++)
			{
				Label label = (Label)this.ReplyList.Items[i].FindControl("lblHuifu");
				if (label != null)
				{
					label.Visible = false;
				}
			}
		}
		if (array2[6].Value != null && array2[6].Value.ToString() != "")
		{
			this.PageReplyCount = int.Parse(array2[6].Value.ToString());
		}
		int num3 = (int)Math.Ceiling((double)this.PageReplyCount / 2.0);
		this.LbExchangePage.Text = this.CurrenPage.CurrPageLink(num, 10, this.PageReplyCount, "条回复", string.Concat(new object[]
		{
			"ShopIndex.aspx?ShopID=",
			this.ShopID,
			"&ColumnTag=",
			this.ColumnTag,
			this.SeeWay,
			this.StrCss,
			"&ThreadID=",
			this.ReplyThreadID,
			"&IsThread=No&pageindex"
		}));
	}
	public string ThreadReplyCount(int ThreadID)
	{
		return this.conn.ExecuteCount("select count(*) from HLMall_Threadreply where AutoReply<>-1 and ThreadID=" + ThreadID).ToString();
	}
	public bool IsStorekeeper(int ShopID, int UserID)
	{
		return this.conn.ExecuteCount(string.Concat(new object[]
		{
			"select count(*) from HLShop_Shop as a,HLMall_Thread as b where a.ShopID=b.ShopID and a.ShopID=",
			ShopID,
			" and a.ShopOwnerID=",
			UserID
		})) > 0;
	}
	public int IsThreadWriter(string ThreadID)
	{
		int result = -1;
		int num = 0;
		try
		{
			num = int.Parse(ThreadID);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			num = 0;
		}
		int num2 = this.conn.ExecuteCount(string.Concat(new object[]
		{
			"select count(*) from HLMall_Thread where ThreadID=",
			num,
			" and WriterID=",
			base.user.UserID
		}));
		if (this.IsStorekeeper(this.ShopID, base.user.UserID))
		{
			if (num2 > 0)
			{
				result = 0;
			}
		}
		else
		{
			if (num2 > 0)
			{
				result = 1;
			}
			else
			{
				result = -1;
			}
		}
		return result;
	}
	public string ThreadStatus(string ThreadID)
	{
		string text = "";
		int[] array = this.JustThreadStatus(ThreadID);
		if (array[1] == 1)
		{
			text = "[<em style='color:red'>置顶</em>]";
		}
		if (array[0] == 1)
		{
			text += "[<em>精华</em>]";
		}
		if (array[2] == 1)
		{
			text += "[<em style='color:red'>锁定</em>]";
			this.ButReply.Visible = false;
			this.ButEdit.Visible = false;
			for (int i = 0; i < this.ReplyList.Items.Count; i++)
			{
				Label label = (Label)this.ReplyList.Items[i].FindControl("lblHuifu");
				if (label != null)
				{
					label.Visible = false;
				}
			}
		}
		return text;
	}
	public int[] JustThreadStatus(string ThreadID)
	{
		int num = 0;
		int num2 = 0;
		int num3 = 0;
		int num4 = 0;
		int[] array = new int[3];
		try
		{
			num = int.Parse(ThreadID);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			num = 0;
		}
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_Thread where ThreadID=" + num);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			try
			{
				num2 = int.Parse(dataTable.Rows[0]["Setsgoes"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num2 = 0;
			}
			try
			{
				num3 = int.Parse(dataTable.Rows[0]["EssenceArea"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num3 = 0;
			}
			try
			{
				num4 = int.Parse(dataTable.Rows[0]["Locking"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num4 = 0;
			}
		}
		dataTable.Dispose();
		if (num2 == 1)
		{
			array[1] = 1;
		}
		if (num3 == 1)
		{
			array[0] = 1;
		}
		if (num4 == 1)
		{
			array[2] = 1;
		}
		return array;
	}
	public string SubProductName(string ProductName, string type)
	{
		string text = ProductName;
		int num = 0;
		if (type == "list")
		{
			num = this.ProImgWidth;
		}
		else
		{
			if (type == "TJ")
			{
				num = this.TJImgWidth;
			}
		}
		if (num >= 220)
		{
			if (text.Length > 16)
			{
				text = text.Substring(0, 16) + "...";
			}
		}
		else
		{
			if (num >= 160)
			{
				if (text.Length > 11)
				{
					text = text.Substring(0, 11) + "...";
				}
			}
			else
			{
				if (text.Length > 9)
				{
					text = text.Substring(0, 9) + "...";
				}
			}
		}
		return text;
	}
	public void ShopPreview(int ShopID)
	{
		this.WstrPrice = " and (case when ProductType=3 and TeamNum=1 then TeamPrice1 when ProductType=3 and TeamNum=2 then TeamPrice2 ";
		this.WstrPrice += "  when ProductType=3 and TeamNum=3 then TeamPrice3 when ProductType=3 and TeamNum=4 then TeamPrice4";
		this.WstrPrice += "  when ProductType=3 and TeamNum=5 then TeamPrice5 else a.StandPrice end)";
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("Keyword") != null)
			{
				string text = HttpUtility.UrlDecode(SetGetCookies.Get("Keyword").Value);
				if (text != "")
				{
					string text2 = "热门：";
					string[] array = text.Split(new char[]
					{
						','
					});
					for (int i = 0; i < array.Length; i++)
					{
						object obj = text2;
						text2 = string.Concat(new object[]
						{
							obj,
							"<a href='ShopIndex.aspx?ShopID=",
							ShopID,
							"&ColumnTag=ProductList",
							this.SeeWay,
							this.StrCss,
							"&SearchKey=",
							array[i],
							"'>",
							array[i],
							"</a>、"
						});
					}
					this.PopularSearch.Text = text2.Substring(0, text2.Length - 1);
				}
			}
			else
			{
				DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=3 and ShopID=" + ShopID);
				if (dataTable != null && dataTable.Rows.Count > 0)
				{
					if (dataTable.Rows[0]["Keyword"] != null)
					{
						if (dataTable.Rows[0]["Keyword"].ToString() != "")
						{
							string text2 = "热门：";
							string[] array = dataTable.Rows[0]["Keyword"].ToString().Split(new char[]
							{
								','
							});
							for (int i = 0; i < array.Length; i++)
							{
								object obj = text2;
								text2 = string.Concat(new object[]
								{
									obj,
									"<a href='ShopIndex.aspx?ShopID=",
									ShopID,
									"&ColumnTag=ProductList",
									this.SeeWay,
									this.StrCss,
									"&SearchKey=",
									array[i],
									"'>",
									array[i],
									"</a>"
								});
							}
							this.PopularSearch.Text = text2;
						}
					}
				}
				dataTable.Dispose();
			}
		}
		else
		{
			DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=3 and ShopID=" + ShopID);
			if (dataTable != null && dataTable.Rows.Count > 0)
			{
				if (dataTable.Rows[0]["Keyword"] != null)
				{
					if (dataTable.Rows[0]["Keyword"].ToString() != "")
					{
						string text2 = "热门：";
						string[] array = dataTable.Rows[0]["Keyword"].ToString().Split(new char[]
						{
							','
						});
						for (int i = 0; i < array.Length; i++)
						{
							object obj = text2;
							text2 = string.Concat(new object[]
							{
								obj,
								"<a href='ShopIndex.aspx?ShopID=",
								ShopID,
								"&ColumnTag=ProductList",
								this.SeeWay,
								this.StrCss,
								"&SearchKey=",
								array[i],
								"'>",
								array[i],
								"</a>、"
							});
						}
						this.PopularSearch.Text = text2.Substring(0, text2.Length - 1);
					}
				}
			}
			dataTable.Dispose();
		}
		DataTable dataTable2 = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=8 and ShopID=" + ShopID);
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("TopCusName") != null)
			{
				if (SetGetCookies.Get("TopCusName").Value != "")
				{
					this.HiTopCusName.Value = HttpUtility.UrlDecode(SetGetCookies.Get("TopCusName").Value);
				}
				else
				{
					this.HiTopCusName.Value = dataTable2.Rows[0]["ModuleName"].ToString();
				}
			}
			else
			{
				this.HiTopCusName.Value = dataTable2.Rows[0]["ModuleName"].ToString();
			}
			if (SetGetCookies.Get("TopCusComment") != null)
			{
				if (SetGetCookies.Get("TopCusComment").Value != "")
				{
					this.HiTopCusComment.Value = HttpUtility.UrlDecode(SetGetCookies.Get("TopCusComment").Value);
				}
				else
				{
					this.HiTopCusComment.Value = dataTable2.Rows[0]["CustomizeComment"].ToString();
				}
			}
			else
			{
				this.HiTopCusComment.Value = dataTable2.Rows[0]["CustomizeComment"].ToString();
			}
		}
		else
		{
			try
			{
				this.HiTopCusName.Value = dataTable2.Rows[0]["ModuleName"].ToString();
				this.HiTopCusComment.Value = dataTable2.Rows[0]["CustomizeComment"].ToString();
			}
			catch
			{
			}
		}
		dataTable2.Dispose();
		DataTable dataTable3 = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=9 and ShopID=" + ShopID);
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("LeftCusName") != null)
			{
				if (SetGetCookies.Get("LeftCusName").Value != "")
				{
					this.HiLeftCusName.Value = HttpUtility.UrlDecode(SetGetCookies.Get("LeftCusName").Value);
				}
				else
				{
					this.HiLeftCusName.Value = dataTable3.Rows[0]["ModuleName"].ToString();
				}
			}
			else
			{
				this.HiLeftCusName.Value = dataTable3.Rows[0]["ModuleName"].ToString();
			}
			if (SetGetCookies.Get("LeftCusComment") != null)
			{
				if (SetGetCookies.Get("LeftCusComment").Value != "")
				{
					this.HiLeftCusComment.Value = HttpUtility.UrlDecode(SetGetCookies.Get("LeftCusComment").Value);
				}
				else
				{
					this.HiLeftCusComment.Value = dataTable3.Rows[0]["CustomizeComment"].ToString();
				}
			}
			else
			{
				this.HiLeftCusComment.Value = dataTable3.Rows[0]["CustomizeComment"].ToString();
			}
		}
		else
		{
			try
			{
				this.HiLeftCusName.Value = dataTable3.Rows[0]["ModuleName"].ToString();
				this.HiLeftCusComment.Value = dataTable3.Rows[0]["CustomizeComment"].ToString();
			}
			catch
			{
			}
		}
		dataTable3.Dispose();
		DataTable dataTable4 = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=10 and ShopID=" + ShopID);
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("RightCusName") != null)
			{
				if (SetGetCookies.Get("RightCusName").Value != "")
				{
					this.HiRightCusName.Value = HttpUtility.UrlDecode(SetGetCookies.Get("RightCusName").Value);
				}
				else
				{
					this.HiRightCusName.Value = dataTable4.Rows[0]["ModuleName"].ToString();
				}
			}
			else
			{
				this.HiRightCusName.Value = dataTable4.Rows[0]["ModuleName"].ToString();
			}
			if (SetGetCookies.Get("RightCusComment") != null)
			{
				if (SetGetCookies.Get("RightCusComment").Value != "")
				{
					this.HiRightCusComment.Value = HttpUtility.UrlDecode(SetGetCookies.Get("RightCusComment").Value);
				}
				else
				{
					this.HiRightCusComment.Value = dataTable4.Rows[0]["CustomizeComment"].ToString();
				}
			}
			else
			{
				this.HiRightCusComment.Value = dataTable4.Rows[0]["CustomizeComment"].ToString();
			}
		}
		else
		{
			this.HiRightCusName.Value = dataTable4.Rows[0]["ModuleName"].ToString();
			this.HiRightCusComment.Value = dataTable4.Rows[0]["CustomizeComment"].ToString();
		}
		dataTable4.Dispose();
		this.RankSorting(ShopID);
		DataTable dataTable5 = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=5 and ShopID=" + ShopID);
		int num = 6;
		string text3 = " order by CreateTime desc";
		string text4;
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("ElitePicSize") != null)
			{
				try
				{
					this.TJImgHeight = int.Parse(SetGetCookies.Get("ElitePicSize").Value);
					this.TJImgWidth = int.Parse(SetGetCookies.Get("ElitePicSize").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					this.TJImgHeight = 120;
					this.TJImgWidth = 120;
				}
			}
			else
			{
				try
				{
					this.TJImgHeight = int.Parse(dataTable5.Rows[0]["Picturesize"].ToString());
					this.TJImgWidth = int.Parse(dataTable5.Rows[0]["Picturesize"].ToString());
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					this.TJImgHeight = 120;
					this.TJImgWidth = 120;
				}
			}
			if (SetGetCookies.Get("EliteProNum") != null)
			{
				try
				{
					num = int.Parse(SetGetCookies.Get("EliteProNum").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num = 6;
				}
			}
			else
			{
				try
				{
					num = int.Parse(dataTable5.Rows[0]["ShowProductNum"].ToString());
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num = 6;
				}
			}
			if (SetGetCookies.Get("EliteOrderBy") != null)
			{
				text4 = SetGetCookies.Get("EliteOrderBy").Value;
			}
			else
			{
				text4 = dataTable5.Rows[0]["Sortingway"].ToString();
			}
		}
		else
		{
			try
			{
				this.TJImgHeight = int.Parse(dataTable5.Rows[0]["Picturesize"].ToString());
				this.TJImgWidth = int.Parse(dataTable5.Rows[0]["Picturesize"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				this.TJImgHeight = 120;
				this.TJImgWidth = 120;
			}
			try
			{
				num = int.Parse(dataTable5.Rows[0]["ShowProductNum"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num = 6;
			}
			text4 = dataTable5.Rows[0]["Sortingway"].ToString();
		}
		string text5 = text4;
		if (text5 != null)
		{
			if (!(text5 == "NewOn"))
			{
				if (!(text5 == "Lowprice"))
				{
					if (text5 == "Hightprice")
					{
						text3 = " order by CurrentPrice desc ";
					}
				}
				else
				{
					text3 = " order by CurrentPrice asc ";
				}
			}
			else
			{
				text3 = " order by CreateTime desc ";
			}
		}
		string sql = string.Concat(new object[]
		{
			"select top ",
			num,
			" * from HLShop_Product where IsElite=1 and EnableSingleSell=1 and EnableSale=1 and ShopID=",
			ShopID,
			text3
		});
		this.RecommendationList.DataSource = this.conn.GetDataTable(sql);
		this.RecommendationList.DataBind();
		DataTable dataTable6 = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=7 and ShopID=" + ShopID);
		string text6 = "";
		int num2 = -1;
		int num3 = -1;
		decimal num4 = 0m;
		decimal num5 = 0m;
		int num6 = 10;
		string text7;
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("PLModuleName") != null)
			{
				this.ProductListName.Text = HttpUtility.UrlDecode(SetGetCookies.Get("PLModuleName").Value);
			}
			else
			{
				this.ProductListName.Text = dataTable6.Rows[0]["ModuleName"].ToString();
			}
			if (SetGetCookies.Get("PLKeyword") != null)
			{
				text6 = HttpUtility.UrlDecode(SetGetCookies.Get("PLKeyword").Value);
			}
			else
			{
				if (dataTable6.Rows[0]["Keyword"] != null)
				{
					text6 = dataTable6.Rows[0]["Keyword"].ToString();
				}
			}
			if (SetGetCookies.Get("PLSelectClassID") != null)
			{
				try
				{
					num2 = int.Parse(SetGetCookies.Get("PLSelectClassID").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num2 = -1;
				}
			}
			else
			{
				num2 = int.Parse(dataTable6.Rows[0]["ClassID"].ToString());
			}
			if (SetGetCookies.Get("PLProductType") != null)
			{
				try
				{
					num3 = int.Parse(SetGetCookies.Get("PLProductType").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num3 = -1;
				}
			}
			else
			{
				num3 = int.Parse(dataTable6.Rows[0]["ProductType"].ToString());
			}
			if (SetGetCookies.Get("PLPrice1") != null)
			{
				try
				{
					num4 = decimal.Parse(SetGetCookies.Get("PLPrice1").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num4 = 0m;
				}
			}
			else
			{
				num4 = decimal.Parse(dataTable6.Rows[0]["Pricerange1"].ToString());
			}
			if (SetGetCookies.Get("PLPrice2") != null)
			{
				try
				{
					num5 = decimal.Parse(SetGetCookies.Get("PLPrice2").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num5 = 0m;
				}
			}
			else
			{
				num5 = decimal.Parse(dataTable6.Rows[0]["Pricerange2"].ToString());
			}
			if (SetGetCookies.Get("PLpicSize") != null)
			{
				try
				{
					this.ProImgHeight = int.Parse(SetGetCookies.Get("PLpicSize").Value);
					this.ProImgWidth = int.Parse(SetGetCookies.Get("PLpicSize").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					this.ProImgHeight = 120;
					this.ProImgWidth = 120;
				}
			}
			else
			{
				this.ProImgWidth = int.Parse(dataTable6.Rows[0]["Picturesize"].ToString());
				this.ProImgHeight = int.Parse(dataTable6.Rows[0]["Picturesize"].ToString());
			}
			if (SetGetCookies.Get("PLitemNum") != null)
			{
				try
				{
					num6 = int.Parse(SetGetCookies.Get("PLitemNum").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num6 = 10;
				}
			}
			else
			{
				num6 = int.Parse(dataTable6.Rows[0]["ShowProductNum"].ToString());
			}
			if (SetGetCookies.Get("PLorderType") != null)
			{
				text7 = SetGetCookies.Get("PLorderType").Value;
			}
			else
			{
				text7 = dataTable6.Rows[0]["Sortingway"].ToString();
			}
		}
		else
		{
			this.ProductListName.Text = dataTable6.Rows[0]["ModuleName"].ToString();
			if (dataTable6.Rows[0]["Keyword"] != null)
			{
				text6 = dataTable6.Rows[0]["Keyword"].ToString();
			}
			num2 = int.Parse(dataTable6.Rows[0]["ClassID"].ToString());
			num3 = int.Parse(dataTable6.Rows[0]["ProductType"].ToString());
			num4 = decimal.Parse(dataTable6.Rows[0]["Pricerange1"].ToString());
			num5 = decimal.Parse(dataTable6.Rows[0]["Pricerange2"].ToString());
			this.ProImgWidth = int.Parse(dataTable6.Rows[0]["Picturesize"].ToString());
			this.ProImgHeight = int.Parse(dataTable6.Rows[0]["Picturesize"].ToString());
			num6 = int.Parse(dataTable6.Rows[0]["ShowProductNum"].ToString());
			text7 = dataTable6.Rows[0]["Sortingway"].ToString();
		}
		string sql2 = "";
		string text8 = "";
		if (text6 != "")
		{
			text8 = text8 + " and ProductName like '%" + text6 + "%'";
		}
		if (num2 != -1)
		{
			text8 = text8 + " and ClassID=" + num2;
		}
		if (num3 != -1)
		{
			text8 = text8 + " and ProductStandard=" + num3;
		}
		if (num4 != 0m && num5 != 0m)
		{
			object obj = text8;
			text8 = string.Concat(new object[]
			{
				obj,
				this.WstrPrice,
				">=",
				num4,
				this.WstrPrice,
				"<=",
				num5
			});
		}
		text5 = text7;
		if (text5 != null)
		{
			if (!(text5 == "Humanspirit"))
			{
				if (!(text5 == "Hotkeep"))
				{
					if (!(text5 == "NewOn"))
					{
						if (!(text5 == "Lowprice"))
						{
							if (text5 == "Hightprice")
							{
								sql2 = string.Concat(new object[]
								{
									"select top ",
									num6,
									" * from HLShop_Product as a where EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
									ShopID,
									text8,
									" order by CurrentPrice desc"
								});
							}
						}
						else
						{
							sql2 = string.Concat(new object[]
							{
								"select top ",
								num6,
								" * from HLShop_Product as a where EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
								ShopID,
								text8,
								" order by CurrentPrice asc "
							});
						}
					}
					else
					{
						sql2 = string.Concat(new object[]
						{
							"select top ",
							num6,
							" * from HLShop_Product as a where EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
							ShopID,
							text8,
							" order by CreateTime desc"
						});
					}
				}
				else
				{
					sql2 = string.Concat(new object[]
					{
						"select top ",
						num6,
						" * from HLShop_Product as a where EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
						ShopID,
						text8,
						" order by FavouriteNum desc"
					});
				}
			}
			else
			{
				sql2 = string.Concat(new object[]
				{
					"select top ",
					num6,
					" * from HLShop_Product as a where EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
					ShopID,
					text8,
					" order by CreateTime desc"
				});
			}
		}
		this.ReProductList.DataSource = this.conn.GetDataTable(sql2);
		this.ReProductList.DataBind();
		if (this.threadNum == 0)
		{
			this.threadNum = 20;
		}
		this.ThreadWhere();
		this.ReHomeThreadList.DataSource = this.conn.GetDataTable(string.Concat(new object[]
		{
			"select top ",
			this.threadNum,
			" a.CreateTime as CTime,a.ThreadID as ThdID, * from HLMall_Thread as a,HLMall_Threadreply as b where a.threadID=b.threadID and b.replyID in(select max(replyID) from HLMall_Threadreply group by ThreadID) and a.ShopID=",
			ShopID,
			this.ThstrOrdery
		}));
		this.ReHomeThreadList.DataBind();
	}
	public void ThreadWhere()
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=6 and ShopID=" + this.ShopID);
		DataRow dataRow = dataTable.Rows[0];
		int num = 1;
		if (base.Request.QueryString["SeeWay"] != null)
		{
			if (SetGetCookies.Get("JlOrderByID") != null)
			{
				try
				{
					num = int.Parse(SetGetCookies.Get("JlOrderByID").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					num = 1;
				}
			}
			else
			{
				num = int.Parse(dataRow["PostsShowType"].ToString());
			}
			if (SetGetCookies.Get("JlShowPostsNum") != null)
			{
				try
				{
					this.threadNum = int.Parse(SetGetCookies.Get("JlShowPostsNum").Value);
				}
				catch (Exception ex)
				{
					ex.WriteErrorLog(new string[]
					{
						"正常操作"
					});
					this.threadNum = 3;
				}
			}
			else
			{
				this.threadNum = int.Parse(dataRow["ShowPostsNum"].ToString());
			}
		}
		else
		{
			num = int.Parse(dataRow["PostsShowType"].ToString());
			this.threadNum = int.Parse(dataRow["ShowPostsNum"].ToString());
		}
		switch (num)
		{
		case 1:
			this.ThstrOrdery = " order by case when a.setsgoes>0 then 0 else 1 end,a.setsgoes asc, a.threadid desc ";
			break;
		case 2:
			this.ThstrOrdery = "order by case when a.EssenceArea>0 then 0 else 1 end,a.EssenceArea asc, a.threadid desc";
			break;
		case 3:
			this.ThstrOrdery = " order by a.EndReplyDate asc ";
			break;
		case 4:
			this.ThstrOrdery = " order by a.UpdateTime desc ";
			break;
		}
		dataTable.Dispose();
	}
	public void BindFriendLink()
	{
		this.ReFriendLink.DataSource = this.conn.GetDataTable("select a.ShopID as SID,* from HLShop_FriendLink as a,HLShop_Shop as b where a.FriendUserId=b.ShopOwnerID and a.ShopID=" + this.ShopID);
		this.ReFriendLink.DataBind();
	}
	public void RankSorting(int ShopID)
	{
		DataTable dataSource = null;
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=1 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			DataRow dataRow = dataTable.Rows[0];
			int num = -1;
			int num2 = 0;
			decimal num3 = 0m;
			decimal num4 = 0m;
			string text = "";
			string text2;
			if (base.Request.QueryString["SeeWay"] != null)
			{
				if (SetGetCookies.Get("RankModuleName") != null)
				{
					this.ProductRankName.Text = SetGetCookies.Get("RankModuleName").Value;
				}
				else
				{
					this.ProductRankName.Text = dataRow["ModuleName"].ToString();
				}
				if (SetGetCookies.Get("RankClassID") != null)
				{
					try
					{
						num = int.Parse(SetGetCookies.Get("RankClassID").Value);
					}
					catch (Exception)
					{
						num = -1;
					}
				}
				else
				{
					num = int.Parse(dataRow["ClassID"].ToString());
				}
				if (SetGetCookies.Get("RankShowNum") != null)
				{
					try
					{
						num2 = int.Parse(SetGetCookies.Get("RankShowNum").Value);
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[]
						{
							"正常操作"
						});
						num2 = 0;
					}
				}
				else
				{
					num2 = int.Parse(dataRow["ShowProductNum"].ToString());
				}
				if (SetGetCookies.Get("RankPrice1") != null)
				{
					try
					{
						num3 = decimal.Parse(SetGetCookies.Get("RankPrice1").Value);
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[]
						{
							"正常操作"
						});
						num3 = 0m;
					}
				}
				else
				{
					num3 = decimal.Parse(dataRow["Pricerange1"].ToString());
				}
				if (SetGetCookies.Get("RankPrice2") != null)
				{
					try
					{
						num4 = decimal.Parse(SetGetCookies.Get("RankPrice2").Value);
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[]
						{
							"正常操作"
						});
						num4 = 0m;
					}
				}
				else
				{
					num4 = decimal.Parse(dataRow["Pricerange2"].ToString());
				}
				if (SetGetCookies.Get("RankShowType") != null)
				{
					text2 = SetGetCookies.Get("RankShowType").Value;
				}
				else
				{
					text2 = dataRow["ShowType"].ToString();
				}
			}
			else
			{
				this.ProductRankName.Text = dataRow["ModuleName"].ToString();
				num = int.Parse(dataRow["ClassID"].ToString());
				num2 = int.Parse(dataRow["ShowProductNum"].ToString());
				num3 = decimal.Parse(dataRow["Pricerange1"].ToString());
				num4 = decimal.Parse(dataRow["Pricerange2"].ToString());
				text2 = dataRow["ShowType"].ToString();
			}
			if (base.Request.QueryString["RankTag"] != null)
			{
				text2 = base.Request.QueryString["RankTag"];
			}
			string text3 = text2;
			if (text3 != null)
			{
				if (!(text3 == "topSelling"))
				{
					if (text3 == "topCollect")
					{
						string str = " and a.EnableSale=1 and a.Stocks>0 and a.EnableSingleSell=1";
						text += str;
						if (num != -1)
						{
							text = text + " and ClassID=" + num;
						}
						if (num3 != 0m && num4 != 0m)
						{
							object obj = text;
							text = string.Concat(new object[]
							{
								obj,
								this.WstrPrice,
								">",
								num3,
								this.WstrPrice,
								"<",
								num4
							});
						}
						dataSource = Shop_Product.instance.GetMyFavouriteProductByShopID(ShopID, num2, text);
					}
				}
				else
				{
					string str2 = " and a.EnableSale=1 and a.Stocks>0 and a.EnableSingleSell=1";
					text = " DateDiff(MM,b.InputTime,getdate())=0 and b.OrderFormID=c.OrderFormID and a.ProductID=c.ProductID " + str2;
					if (num != -1)
					{
						text = text + " and a.ClassID=" + num;
					}
					object obj;
					if (num3 != 0m && num4 != 0m)
					{
						obj = text;
						text = string.Concat(new object[]
						{
							obj,
							this.WstrPrice,
							">=",
							num3,
							this.WstrPrice,
							"<=",
							num4
						});
					}
					string text4 = "(select sum(Quantity) from HLShop_OrderItem as oi join HLShop_Order as o on oi.ProductID=a.ProductID and  o.OrderFormNum=oi.OrderFormNum  and o.Status=2) as BuyTimes,";
					string text5 = " a.FavouriteNum,a.ProductID,a.ProductName,a.StandPrice,a.PUnit,a.ProductImageUrl,a.ProductSmallImageUrl,a.Stocks,a.ShopID,a.SalerID,a.ProductPlace,a.ProductNum,a.ClassID";
					obj = text;
					text = string.Concat(new object[]
					{
						obj,
						" and a.ShopID=",
						ShopID,
						" group by ",
						text5,
						" order by BuyTimes desc"
					});
					string sql = string.Concat(new object[]
					{
						"select top ",
						num2,
						text4,
						text5,
						" from HLShop_Product as a,HLShop_Order as b,HLShop_OrderItem as c where ",
						text
					});
					dataSource = this.conn.GetDataTable(sql);
				}
			}
			this.ReShopRankList.DataSource = dataSource;
			this.ReShopRankList.DataBind();
			text3 = text2;
			if (text3 != null)
			{
				if (!(text3 == "topSelling"))
				{
					if (text3 == "topCollect")
					{
						for (int i = 0; i < this.ReShopRankList.Items.Count; i++)
						{
							Panel panel = (Panel)this.ReShopRankList.Items[i].FindControl("pnltopSelling");
							Panel panel2 = (Panel)this.ReShopRankList.Items[i].FindControl("pnltopCollect");
							if (panel != null && panel2 != null)
							{
								panel.Attributes.Add("style", "display:none");
								panel2.Attributes.Add("style", "display:block");
							}
						}
					}
				}
				else
				{
					for (int i = 0; i < this.ReShopRankList.Items.Count; i++)
					{
						Panel panel = (Panel)this.ReShopRankList.Items[i].FindControl("pnltopSelling");
						Panel panel2 = (Panel)this.ReShopRankList.Items[i].FindControl("pnltopCollect");
						if (panel != null && panel2 != null)
						{
							panel.Attributes.Add("style", "display:block");
							panel2.Attributes.Add("style", "display:none");
						}
					}
				}
			}
		}
		dataTable.Dispose();
	}
	public void ShowAllProduct(int ShopID)
	{
		this.WstrPrice = " and (case when ProductType=3 and TeamNum=1 then TeamPrice1 when ProductType=3 and TeamNum=2 then TeamPrice2 ";
		this.WstrPrice += "  when ProductType=3 and TeamNum=3 then TeamPrice3 when ProductType=3 and TeamNum=4 then TeamPrice4";
		this.WstrPrice += "  when ProductType=3 and TeamNum=5 then TeamPrice5 else StandPrice end)";
		string text = "";
		decimal num = 0m;
		decimal num2 = 0m;
		string text2 = "";
		string text3 = "";
		if (base.Request.QueryString["RankTag"] != null)
		{
			if (base.Request.QueryString["RankTag"] == "topCollect")
			{
				text3 = "&RankTag=topCollect";
			}
		}
		if (base.Request.QueryString["KeyPrice1"] != null && base.Request.QueryString["KeyPrice2"] != null)
		{
			try
			{
				num = decimal.Parse(base.Request.QueryString["KeyPrice1"]);
				num2 = decimal.Parse(base.Request.QueryString["KeyPrice2"]);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num = 0m;
				num2 = 0m;
			}
		}
		if (base.Request.QueryString["SearchKey"] != null)
		{
			text2 = base.Request.QueryString["SearchKey"];
		}
		if (num != 0m && num2 != 0m)
		{
			object obj = text;
			text = string.Concat(new object[]
			{
				obj,
				this.WstrPrice,
				">=",
				num,
				this.WstrPrice,
				"<=",
				num2
			});
		}
		if (text2 != "")
		{
			text = text + " and ProductName like '%" + text2 + "%'";
		}
		int num3 = 1;
		if (base.Request.QueryString["pageindex"] != null && base.Request.QueryString["pageindex"].ToString() != "")
		{
			try
			{
				num3 = int.Parse(base.Request.QueryString["pageindex"].ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num3 = 1;
			}
		}
		int num4 = 12;
		int num5 = (num3 - 1) * num4;
		int pCount;
		if (base.Request.QueryString["ClassID"] != null)
		{
			DataTable dataTable = this.conn.GetDataTable("select * from HLShop_ProductLikeCategory where ShopProductClassID=" + base.Request.QueryString["ClassID"]);
			string text4 = string.Empty;
			if (dataTable != null && dataTable.Rows.Count > 0)
			{
				if (dataTable.Rows[0]["ProductArrayID"] != DBNull.Value && dataTable.Rows[0]["ProductArrayID"] != null)
				{
					text4 = dataTable.Rows[0]["ProductArrayID"].ToString();
				}
			}
			if (string.IsNullOrEmpty(text4))
			{
				return;
			}
			text4 = text4.Trim().Trim(new char[]
			{
				','
			});
			pCount = this.conn.ExecuteCount(string.Concat(new object[]
			{
				"select count(*)  from HLShop_Product   where ProductID in (",
				text4,
				") and   EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
				ShopID,
				text
			}));
			this.ReAllProductList.DataSource = this.conn.GetDataSet(string.Concat(new object[]
			{
				"select top ",
				num4,
				" * from HLShop_Product   where ProductID in (",
				text4,
				") and   EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 and ShopID=",
				ShopID,
				text,
				" order by CreateTime desc"
			}));
			this.ReAllProductList.DataBind();
		}
		else
		{
			string text5 = "EnableSale=1 and Stocks>0 and DateDiff(s,getdate(),EndDate)>0 ";
			string text6 = " order by CreateTime desc";
			string sql = string.Concat(new object[]
			{
				"select count(*) from HLShop_Product where ",
				text5,
				" and ShopID=",
				ShopID,
				" ",
				text
			});
			pCount = this.conn.ExecuteCount(sql);
			string text7 = string.Concat(new object[]
			{
				"select ROW_NUMBER() over(",
				text6,
				") as number,* from HLShop_Product where ",
				text5,
				" and ShopID=",
				ShopID,
				" ",
				text
			});
			string sql2 = string.Concat(new object[]
			{
				"select * from (",
				text7,
				") t where t.number>",
				(num3 - 1) * num4,
				" and t.number<=",
				num3 * num4
			});
			this.ReAllProductList.DataSource = this.conn.GetDataSet(sql2);
			this.ReAllProductList.DataBind();
		}
		this.lbProductNumber.Text = pCount.ToString();
		this.AllProductPage.Text = this.CurrenPage.CurrPageLink(num3, num4, pCount, "个商品", string.Concat(new object[]
		{
			"ShopIndex.aspx?ShopID=",
			ShopID,
			"&ColumnTag=ProductList",
			text3,
			this.SeeWay,
			this.StrCss,
			"&KeyPrice1=",
			num,
			"&KeyPrice2=",
			num2,
			"&SearchKey=",
			text2,
			"&pageindex"
		}));
	}
	public string ShowReplyList2(string replyId)
	{
		string text = "";
		string sql = "select * from HLMall_Threadreply  where AutoReply<>-1 and ThreadID=" + replyId + " order by replyID desc";
		DataTable dataTable = this.conn.GetDataTable(sql);
		if (dataTable.Rows.Count > 0)
		{
			text += "<table style='text-align:left;margin-top:10px;font-size:18px;background-color:#CCCCe0'>";
			for (int i = 0; i < dataTable.Rows.Count; i++)
			{
				string text2 = "";
				string text3 = "";
				string text4 = "";
				string text5 = "<span style='color: #00000; font-size: 16px; font-family: Georgia; font-style: italic;margin-left: 30px;'>(" + (i + 1) + ")</span>";
				if (dataTable.Rows[i]["replyWriter"] != DBNull.Value)
				{
					text2 = dataTable.Rows[i]["replyWriter"].ToString();
				}
				if (dataTable.Rows[i]["CreateTime"] != DBNull.Value)
				{
					text3 = dataTable.Rows[i]["CreateTime"].ToString();
				}
				if (dataTable.Rows[i]["replyContent"] != DBNull.Value)
				{
					text4 = dataTable.Rows[i]["replyContent"].ToString();
				}
				string text6 = text;
				text = string.Concat(new string[]
				{
					text6,
					"<tr><td>",
					text5,
					"<span style='margin-left: 20px'>作者：",
					text2,
					"&nbsp;&nbsp;&nbsp;&nbsp;时间：",
					text3,
					"</span><br><span style='margin-left: 75px'>内容：",
					text4,
					"</span></td></tr>"
				});
			}
			text += "</table>";
		}
		return text;
	}
}
